<style type="text/css">
fieldset {width:600px;float:left;}
.form_row, label, textarea, #page_title {clear:both;width:100%;float:left;}
label {padding:10px 0;text-transform:capitalize;}
textarea {height:250px;}
#edit_regions textarea {height:150px;}
.form_row {padding:10px 0 10px 0;}
</style>

<%= form_for([:regulate , :admin , @page], :as => :page)  do |f| %>
  <fieldset id="page_form">
    <div id="custom_field_errors"></div>
    <% if !@page.persisted? %>
      <div class="form_row">
        <%= f.label :title %>
        <%= f.text_field :title %>
      </div>
    <% else %>
      <div class="form_row">
        Title: <%= @page.title %>
      </div>
    <% end %>
    <div class="form_row">
      <%= f.label :published %>
      <%= f.check_box :published %>
    </div>
    <% if @is_admin %>
      <div class="form_row">
        <%= f.label :view %>
        <%= f.text_area :view %>
      </div>
    <% else %>
      <div class="form_row">
        View:<br /> <%= @page.view %>
        <%= f.hidden_field :view %>
      </div>
    <% end %>
    <div id="edit_regions"></div>
    <div class="form_row">
      <%= f.submit "Save" %>
      <%= link_to "Cancel" , regulate_admin_regulate_pages_path %>
    </div>
  </fieldset>
<% end %>
<%= javascript_tag "var existing_custom_fields = #{@page.edit_regions.to_json}" %>
<%= javascript_include_tag "jquery.min.js" %>
<%= javascript_include_tag "regulate_admin" %>
